<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="newsDB.*,newsEntity.*,java.sql.*" %>
<%
	Cookie[] cookies=request.getCookies();
	boolean bool=false;
	if(cookies!=null){
		for(Cookie c:cookies){
			if(c.getName().equals("loadName")){
%>
	<div id="top_login">
    <form action="do_logout.jsp" method="post" >
      <label> 登录名 </label>
      <input type="text" name="uname" id="uname" style='border: none' value=<%=c.getValue() %> readonly="readonly"/>
      <input type="submit" class="login_sub" value="login out" />
      <label id="error"> </label>
      <img src="images/friend_logo.gif" alt="Google" id="friend_logo" />
    </form>
  </div>
<%		
		bool=true;
		break;
			}
		}
	}
	if(!bool){
%>
	<div id="top_login">
    <form action="do_login.jsp" method="post" onsubmit="return check()">
      <label> 登录名 </label>
      <input type="text" name="uname" id="uname" value="" class="login_input" />
      <label> 密&#160;&#160;码 </label>
      <input type="password" name="upwd" id="upwd" value="" class="login_input" />
      <input type="submit" class="login_sub" value="登录" />
      <label id="error" style="color: red"><%=session.getAttribute("message")==null?"":session.getAttribute("message")%></label>
      <img src="images/friend_logo.gif" alt="Google" id="friend_logo" />
    </form>
  </div>
<%
      	session.removeAttribute("message");
	}
%>



